import request from '@/utils/request_1'

// 新增损益单
export const addLoSeProfit = (params: any) =>
  request({
    url: '/increaseDecrease',
    method: 'post',
    data: { ...params }
  })

// 修改损益单
export const updateLoSeProfit = (params: any) =>
  request({
    url: '/increaseDecrease',
    method: 'put',
    data: { ...params }
  })

// 删除损益单
export const deleteLoSeProfit = (params: any) =>
  request({
    url: '/increaseDecrease',
    method: 'delete',
    params
  })

// 查询全部损益单
export const findAllLoSeProfit = (params: any) =>
  request({
    url: '/increaseDecrease/list',
    method: 'get',
    params
  })

// 分页查询损益单
export const findAllLoSeProfitPaging = (params: any) =>
  request({
    url: '/increaseDecrease/page',
    method: 'get',
    params
  })

// 查询损益单
export const findOneLoSeProfit = (id: number) =>
  request({
    url: `/increaseDecrease/${id}`,
    method: 'get'
  })

// 分页查询损益单明细
export const findAllLoSeProfitDetailPaging = (params: any) =>
  request({
    url: '/increaseDecrease/pageDetail',
    method: 'get',
    params
  })

// 调整库存
export const updateStorage = (params: any) =>
  request({
    url: '/increaseDecrease/change',
    method: 'put',
    data: { ...params }
  })

// 取消调整
export const cancleUpdate = (params: any) =>
  request({
    url: '/increaseDecrease/cancel',
    method: 'put',
    data: { ...params }
  })

// 汇总总数与总金额
export const getSumData = () =>
  request({
    url: '/increaseDecrease/sum',
    method: 'get'
  })
